<!-- 意见反馈 -->
<template>
    <div class='yj_wrapper'>
        <van-field v-model="message" rows="1" autosize label="留言：" type="textarea" placeholder="请尽可能详细的描述您在系统使用中遇到的问题，我们的技术团队将尽快予以解决。" />
        <div class="Submission" @click="SubmitBut">提交</div>
    </div>
</template>

<script>
    export default {
        components: {},
        data() {
            return {
                message: '',
            };
        },
        methods: {
            SubmitBut() {
                if (!this.slow.isAuth) {
                // if (!this.slow.isAuth || this.slow.userInfo.subscribe == 0) {
                    this.$dialog
                        .confirm({
                            title: "提示",
                            message: "您还没有认证，是否前去认证？"
                        })
                        .then(() => {
                            this.$router.push("/register");
                        })
                        .catch(() => {
                            // on cancel
                        });
                } else {
                    this.post('/sysFeedback/insert', {
                        wxId: this.slow.userInfo.openId,
                        // wxId:'o9g_ywafeOGzxbOQ_IQ7HXKOSDIM',
                        content: this.message
                    }).then(r => {
                        if (r.success == true) {
                            this.$toast.success(r.message || '提交成功');
                            setTimeout(() => {
                                this.$toast.clear();
                                this.$router.back();
                            }, 2000);
                        } else {
                            this.$toast.fail(r.message || '提交失败');
                        }
                    }).catch(err => {
                        this.$toast.fail('服务器未反应，请稍后重试')
                    })
                }
            }
        },
        created() {}
    }
</script>
<style lang="scss" scoped>
    .van-cell {
        margin-top: 30px;
    }
    .Submission {
        position: absolute;
        bottom: 25vh;
        left: 30vw;
        width: 40vw;
        height: 8vw;
        line-height: 8vw;
        background: #1989fa;
        color: #ffffff;
        text-align: center;
        border-radius: 20px;
    }
</style>